package com.desiy.controller;

import com.desiy.entity.Department;
import com.desiy.service.DepartmentService;
import com.desiy.utils.MsgData;
import com.desiy.utils.ResponseDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collection;
import java.util.List;

/**
 * @author Desiy
 * @date 2020/9/21 11:15
 */
@RestController
@CrossOrigin
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @RequestMapping("/department/findAll")
    public Collection<Department> AllDepart(){
        Collection<Department> departments = departmentService.all_Department();
        return departments;
    }

}
